package com.prs.crm.service.oa.impl;

import java.io.File;
import java.util.Collection;

import com.prs.crm.context.FileUtil;
import com.prs.crm.dao.oa.MyFileDao;
import com.prs.crm.domain.oa.MyFile;
import com.prs.crm.domain.oa.MyFileFolder;
import com.prs.crm.service.impl.BaseServiceImpl;
import com.prs.crm.service.oa.MyFileService;

public class MyFileServiceImpl extends BaseServiceImpl<MyFile, MyFileDao> implements MyFileService{

	@Override
	public Collection<MyFile> getMyFileByFolder(MyFileFolder folder) {
		// TODO Auto-generated method stub
		return this.getDao().getMyFileByFolder(folder);
	}

	@Override
	public void saveFile(MyFile myFile, File file, String fileName) {
		// TODO Auto-generated method stub
		myFile.setAttach(FileUtil.getInstance().createAttach(file, fileName));
		this.getDao().save(myFile);
	}

}
